package com.ruoyi.project.constant.statuEnum;

public enum OrderType {

    SINGLE(0,"单程"),
    CIRCLE(1,"往返");

    private final Integer code;
    private final String info;
    OrderType(Integer code, String info)
    {
        this.code = code;
        this.info = info;
    }

    public Integer getCode()
    {
        return code;
    }

    public String getInfo()
    {
        return info;
    }

    public static String getValue(Integer code) {
        for (OrderType ele : values()) {
            if(ele.getCode() == code) return ele.getInfo();
        }
        return null;
    }

    public static OrderType getOrderType(Integer code) {
        for(OrderType ele : values()) {
            if(ele.getCode() == code) return ele;
        }
        return null;
    }

}
